fixed client exit bug