[minor] make after callback optional and mitigate err via try/catch