capacity should be > than maxCapacity