Cannot read property 'type' of undefined (undefined)