Added stopword filtering and error handling