fix bug in _Layout