Syntax error in hook class