fix error handling for client & run