put layout select in an if