Bug fix #1

fix a bug when you quit the game, if you haven't detach the arry during
the game