fix divide bug which caused incorrect printing