close sub patcher