fixed event hook, fixed tool detection