restore security and email in controller