Added a check in checkClientCredentials() to avoid exception if client credentials are erroneous