closing DB connection with termination