Fixing a freeze issue