parsing args, handling exceptons