added code for connection