add a function with IO