Setting the scale level dynamically