added support for sub elements