fix a bug that may cause hooks to not be invoked...