added error checking to collection index creation