Fix error when no collection is selected