Cut off loop if not needed