added method to close the database connection