fixing z code