Modify move ServerConnect and ServerDisconnect into the function ServerConnectionStateChange