Error: Attempt to get document without setting collection