change percent counter method and some bugfix.