Fix resource declaration order