updated showError logic