fixing a crash