added content type detection function