add read/write mode for lua.lua