Commented the send mail for now. For some reason the funciton is getting called twice.