fix null reference error in test helper