Adjustment to make grid work with resize