store and restore text-selection