added non blocking loop example