add pre-handler