Give some time to mongodb before trying to connect