Updated lua script and added virtual distructors