added signal handling to put in emails laters