move error handlers to where they ought to be...