fix a potential crash