query functionality added'