add debug routine
bugfix scale control