added support to tags that have optional closings