Add safeguard for rare lua error