fix max depth