fixed errors with login and main