Hi, I'm %99.99 percent sure that it's not a script problem, it's a simple modification of session script. Its looks like a IOS problem because this script work perfect in C2801, C2851, AS5300, AS5350, C2821... I'm upload the script if you like see it.
Thnks