fix mistakes in checkNull