added support for exporting nested layers
resolved merge