Remove eval from from run_hook

small improvement to remove `eval` using builtin function `getattr`.