improved login form functionality