fixing the weight losing value on tab selection