added animation for panning