fix null handling