adding a class method via hook