fix some error case