There was an episode of the original twilight zone TV series from the 1960's staring William Shatner with that plot line. In the 1980's when they made the movie they revised and expanded that old story line and added it to the movie. Or at least that is what I think I remember. I could be wrong.