fix crash when empty set weight