fix recursive scan