fixed small error in copy_if helper