Fixes Cannot read property 'name' of undefined