changed backspace to getSelectionEnd()+1