use a proc and next_tick instead of tick_loop