Cannot read property 'path' of null