move zip generate outside click handler