properly handle spill-threshold