add before/after close callback to view