Memory Leak in VelocityGenerate function corrected