refactored use null for empty list check