add overflow check