preparing new query functionality