fixed some glitches