Added command and variable for finding selectedEditIndex  - almost working