fix scaling functions