ticket:10 fix hooks to avoid duplicate lines

test case for some reason calls hooks twice