fix bugs with autoscroll