bug fix in content type finding logic. this really ought to go in another file