Fix local first query issue