updated hooks
added before middleware hooks