fixed some issues on eamil controller