managing querys