fix bug with retained state after commit