add endless loop feature