fixed the pointer issue. needed to create a member instance variable