check for nullref