Fixing a potential crash