conditionally set dimensions