the order of operations matters when dealing with reentrant mutable state