more update checkDatabase function