Fix compilation eror.
Detach before close client.