add hook to update folds when folds are closed or opened