fixing scroll bug with pan