refactored flash and fixed error with login form on 'signup failed' page