added support for embedded layout