bug fix in transform function computing