Added try catch to getTopWindowInnerHeight