only check keys array rather than all object properties for increased speed