Error handling.

Added error handling incase word is not available.