queries in controllerdata (finally after hours of merging)