stop loop if requested by the command