added check to see if curr is still valid.
Merge pull request #1 from ripter/emacsBug

added check to see if curr is still valid.