added rescue for undefined terms
added rescue for undefined terms