updated to have two connect methods