fixes slow query
solve slow query