adding functionality for custom region folding