updated login method