Fixed lua error when writing text into chat box