add offline support for query