fix flight queries and ensure loading data twice doesn't cause errors