bug fix in hooks