bug local variable not linked to function FIXED