added options.document to allow binding to another document