fixed a subtle bug regarding syncing codemirror values