invoice loop changed