fix for loop synthetic logic