null check for datetype