added "rewind" function to the document object
fixed caret.focus