fix various bugs on game end and reset, add in mapid