fixing rescaling