fix for encoding resources with NSCoding