fix null value handling