Fixed bug of check_sum