Added try/catch to SetOwnerWindow