fix potential crash when users disconnect from client