bug fix compute centriods