added error handling to luaScript