codeshare update query for loop is changed