fixed crash on window close for players