Improved index creation

1) It makes sure the collection exists before creating the index
2) It development mode it ensure index everytime