Updating the detection of error 

Added new string and variable