bug fixed email functionality working