added scaling fix