Updated login method