update unit.lua for resource stream