Added fix for scollection re-index throws null pointer