You sure you don't mean `continue` here? Because this loop stops on the first non-file encountered.