added error message to be printed out