Cannot read property 'id' of null