Fixed null reference error