Fixing explore_db()