Fixed disconnection bug on JS