move null check to filter