revert end and begin in range