fix bug where an email that does not exist in the database crashes server