automatically detect screen size