Moved login to seperate action