Fixed a bug when restarting game