Fixed issue with populating undefined values