scaling bug fix