Fixes missing query ids