modified logic_process.lua