You should also check to see it it's getting fuel when you have this problem. Could be a weak fuel pump.
open