register hooks