use 'finally' clause to ensure zfile.close() is called