Bug fix on trade error handling