fixing Layout init broken code