FIX: resource MUST be cleanupped before using