added connect-function