Fix null pointer with setupChat