fix failed case for better error message