solved problem with recursion steps exceed