Updated Logic on Login Controller