updated email controller