adding support for automatically handling nil values