Cannot read property ‘style’ of undefined