fixes some glitches