null reference error solved