updated hook file with stderr and stdout.