Fixed a stupid bug: $index is subject to change after user modify sort
or search condition, and hence is unstable.
To make sure the right record is processed, a timeStamp has to be
passed as the parameter.