fix some issues on layout and grid