added chained query and nested form