shouldn't this check for presence of 'text/plain' instead?