better handling of lua scripts