layout controller from main working