updated for login functionality