fixing of functionality for send mail