Fixed a bug in trying to send the emails 5 times.