Cannot read property 'theme' of undefined