fix bug in resolver-sorting