fixed php warning: hooks should be static functions