fix embarassing bugs in removing hooks