fixed null reference exception.