fixed checkIfDate