workflow states and databasefix