update, check range validity