updated login functionality