added support for auto, main, dirpath for persistence to stack behavior