fixed a bug in the resource decorator