Added defensive coding for editCli