output error message to stderr, more work on main.c