fix depth function warning