put in cout statements for error checking and located but could not fix problem with mutex in the handleMail thread function