add command argument check
fix exception throwing