add max depth and upcase-fix