add islastchunk and change to transform mapper