fix UUID sorting affecting password history truncation