updated to resolve nulls