better checking of cmdline args