fix ranges and hook thread Pipe into gc