Fixed the screen dimension detection bug in UI.initialize()