Trying to fix glitches in game