fixed null reference exception