fixed trailing 0's bug