updated hooks, before middleware support