fix for null reference error