Improve extend-detection