fixing bug #4772
using cloned object in each step of recursion