Remove eval from run_hook

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