Added repeat function in advanced mode