fixed bug -calling variable not set