change end charcode to z