added error to handle EOF errors