Add condition to check the collection existence