Issue with emails not always being sent