setValue now handles when change divides the endblock in case it spans over multiple blocks