Fix the bug in detecting the exception if no date exists