change !blank? to present? in get_primary_key