fix for out of index crash