Use hasOwnProperty when looping over props in objs