fixed delphi code wrong variable