handled empty list case