add ConnectionHandler Function

add ConnectionHandler Function