rearranging stuff to get mailer to work