Fixed issue related to inserting nil value for key in dictionary