return the result when max depth hit