can now pass arguments to hook function