add depth threshold for #521 and pep8.