Fixing issue with transformArray length