Fixing saveResource