prevent cursor jumping