fixed error cases