Fix type error. (object does not implement Document interface)