handling filereadsync errors