Check against doc instead of err