Added layout checking