added onFunctionChanged event