fixed a bug

emails were being sent even though sentMail was false.