Fix the bug that search record in the right order now