correction of bugs in hooks.php