Fix potential crash