fixed the slow query issue.