improve getzdb script