add function open connection