Fixed repeat loop is now working