hook call now pass arguments by references
add hook calls for user customisation