modify lua samples to make them work correctly