Added a few lines to handle non-supported file extensions