fixed the panning bug