added statementes to print stderr
added except pattern