fix bug in layouts