Added error checking for arguments
fixed username/password params in setCredentials(username, password)