Added client error handling