added event for before/after clear