fixed sql queries
added sending encrypted report mails