Added overflow check on redo