Thanks to both replies I have found the answer but there was still something weird going on. The fault lay in the fact that the textvariable should be a reference to variable not $$params{$key}
as i had used however why this only doubled up the -1 I still have no idea. I tried to replicate the behavior in a small prog but found I could not get the same result. Thanks for your considerations