added mime autodetection