added support for nested schemas