added support for null fields in constructor