fixed crash when name is empty