renamed $ctype to $content_type