add pre-hook