Fixed null reference exception