Fixed error in transformation function