fixed validFileType method