fixes for query and design