Cleaned up the database connection