Fixed bug in sorting of idp list