fixed hook implementation