preventing bad dates