more error catching for the client