Fixed Login functionality