expand error code at once in if