Fix a potential crash