shouidn't we use $app->registerHook here? I'd like to keep the code consistent