cleared data race issue in transform function. fixes #32.