fixed bug in horizontal scrolling