bug fix for function reset_insertion_mode()