add functions, make it works.