fixed null pointer exception, when name is null