database connection clean up