removed a wrong isEmpty check