add hooks for dynamically setting the return value handler, and start working on output for check mode