bug fix for weights