fixed null reference error