Added in file type checking