fixed a potential crash