Cannot read property 'response' of undefined