Added check for username and password