Removed the 'with' statement for opening the tarfile