fixed binary case in transform function