fix weight bug