implemented nested layouts and fixed ability bug