fix the client is deleted in a not correct time