fix incorrect collection creation logic.