rewrite error handling on Inbound