It's possible the shark was actually going after a fish. 

A Panama City Beach hammerhead shark recently went viral after being caught on film in a swimmer's worst nightmare. The hammerhead was filmed close to a beachgoer near Splash Resort before suddenly swimming straight at him. While the shark swung away as suddenly as it had approached, both the swimmer and onlookers appeared shaken by the encounter, with people in the video yelling, "Oh no, no, no, no, no!" and "Get out!"

Mike Pharr, who was filming the scene to later show his then-fiancée on the morning of their wedding, later stated in the video description, "At first, it seemed as if the shark was going after the man, BUT upon reviewing I noticed that a small fish instinctively used the man as a shield to escape the shark. It’s my opinion that had the man known the shark was close by and moved he would have quite possibly been mistaken for the fish and been bitten. It seems to me from watching my video multiple times that sharks really aren’t interested in us we just get caught up and are mistakenly targeted by being in the wrong place at the wrong time."

Watch the video below: