fix objectAtIndex crash