managing deconnection of a client
add const to arguments