Cannot read property 'findOne' of undefined