fix bug in try error code