fixed emailing feature so that the messages and subj are in the controller