Fixing a crash issue