added hasOwnProperty checks for object iteration