Added error handling to call of Lua script