added getter for hooks.
dont't try to close stdout stream.
test.