updated lua script initialization procedure