checking only for valid files