fixed a bug for player quit function