cannot index a value of type