fix instead function in demo