bugfix: isDocument check in Firefox