fixed something in rescaling