modify for prevent null exception on function ConnectCallback