fix #1 add query function