fix character corruption