convert to lower case before checking the file type