catch datetime errors