error handling in client, error detection in server main