fix bug with non empty contentTypes, add test case