lots of fixes

fixes #102 and fixes duplicated hook problem