Fix #6647

Make sure the preference order is the right one. This could partial fix if @dangoor would want to change the adding to scope as per order of call (as opposed to order of resolving promises which is how it is done now).