Change in Client.authenticate() method to execute the callback when gets into ERROR state