fixed some isue afer layour fix functions