added support of optional fields