change printf to cerr