Cannot read property '_doc' of undefined