improvement of #723 which fixes the contenttype for text