exit with status 1 if execptions is raised
fix new line at the eof