minor fixes in hook and hook handling method