The function has very limited functionality and can often fail due to inability to reach through non-objects. A different solution is needed.