fix the bug of upgrading, and rebuilding units after each wave