Fix bug with emails not sending