Added support for hooks (#8)