hook class and better debugging