discarding invalid changes