better db wait