Correcting loans order in loan history