Fix bug from overflow