fixed unhandled exception when content type is not set properly