added mime type check