write errors to cerr, check if teacher ID is valid