Thanks for the help everyone. The other week I found that the small ground wire for the solenoid was in bad shape so I replaced that and it has been working ever since.