fixed mimetype detection