wait for db