pass $ctx (instead of client) to hook