updated cli logic