TypeError: Cannot read property 'snippet' of undefined