added memory-secure chunk support