Fixed issue with undoing text