fix null reference