Null reference fix