Randomly shuts off

Why would it run fine otherwise? I thought that before though and cleaned everything, and the fuel filter was nice and clean too. dropped the tank and cleaned everything so there isn't anything in the tank.

Yep new cap and vent is working as it should.