fixed issue with resource ordering