fix some buggy behaviour with scrolling