Add query function and page