fixed bug related to `hasNext` ignoring that objects have not enough depth to take next steps