added queries, bugfixes