fix scale factor bug