Moved hide_login into it's own function