Closed the connections at the end of run_calc