added try/catch for unmatched file types