modified email controller