fixed up queries