fixed infinite recursion bug'