fixed #684 Cannot read property 'loc' of undefined error