patched code to use getContentType()