change lua code to new