fixed hook logic