retrying to connect to db