add feature that apply event while state change