fix detection of screen width.