Added != null checking