Hopefully fixed the query problem