use go-loop and add if test