fix crash in poly indexing