added missing brace in getWeights