Fixed bug with assignemnt sorting