Added ability to disable loops