Added error tracking and email