fix scaling bug