preparing to do matching query after sql bug fixed