added error msg on try catch