add support for optional elements