get -z option working correctly