Bug fix for getting window size

Bug fix for getting window size