Added dynamic resize for grid