added offset storage inside plugin closure