Changed code based on what Iwju suggested

@line 38 : invalid arguments
@line 47 : Hook manager doesn't contain deregister