fixed bug that auto-hscroll does not work