added fix for slow query issue in parallel