added another condition for validating credentials.