fix scrolling conditions