Add DatabaseState to handle synchonising issue