changed exception handling and logs
added mockito and ability to skip sending mail on first iteration + testing