prevent 'Uncaught TypeError: Cannot read property 'Content-Type' of undefined'