Fixed email and when a query has been executed a log is created.