add query support closes #3