fix bug in player close functionality