added error cases