exit with right error code
when using list_mode