changed cout to cerr for message