Order of database updates was not correct