Baby nightmares?

Ma

I know everything online says it takes awhile for babies to be able to dream but my 5 month old keeps screaming while he’s still asleep. If I just let him scream he usually goes back to sleep in a min or two but I feel bad. Anyone ever have a similar experience or have any tips?