Added hooks functionality