bugfix of loop feature