Modified login functionality