Added validation for username and password