need to serialize the expect script before doing comparison.