Updated Login functionality