this is the working version which creates the collection, then sends to browser