correct scrolling and panning