fixed bug when stopping before selecting block of text would throw exception