fixed logging and email formats