fix bug in main.lua