fix cleanup writes to dynamodb states table
patch version 6