Fixed hooks not running properly