now using correct method to get window width