fix updated_target to deal with duplicate entries