added some backspace handling