add lua script error handler