added "wait" option for up to 5 minutes of retrying initial connection