Cannot access offset of type string on string