I don't this this unchecked cast is OK? Moreover, the field could be multivalued while you only seem to get the first value here?