update scroll and touch function