Update regular expresion about error message
Improved code for detecting the value of Subject
Remove unused variable
Fix test code