fix potential crash