extract ending date (and refactor this)
export into different path
prevent Connection errors from stopping the process