test & train & shutting down error writing