changed from checking != null to .equals(null)