fixed error-handling and backspace