add function and triger