updating shouldTransform method