Fixed a potential crash