Add beforeChange event

Issue #1244