add some state to db after write to device