Fix client crashing