Fixes bug in state mutation in record command