Fix layout edit bug