Fix issue with emails not being sent