Fixing zhistory overwrite problem