change query from online to offline