replacing .begin with begin()