added error handling for client's method