some changes to handle issues with Content Type