fix lua code