less hacky fix for out-of-sync issue when exiting insert mode