Fixing errors that occur when client disconnects
using Ace editor because it has much more sane cursor positions