fix bugs causing crash and another causing repetition of story.