fixes for optimizing scaling