fixed issue 1705, sorting of model, thanks Anthony