Added check for DateTime value