Updated login method.