close database connection after retrieving data with it