changed stderr print to assert