catch backspace and remove the last char