Updated login ctrl logic