Added try/catch for window.parent calls