fix date detection with file option