adds get function for subobjects