Undefined variable in comments hook