simplify setInterval to use go function