initial fix for lua scripting crash