fix issue with caret jumping and weirdness