prevent null date from being used