added setCredentials() method