fixed bug in handling player leaving