updated main cli logic