check for window width before building bar width