Started a function to check file type