handle ValueError when parsing dates