added validate functions and login window