Working on looping cmd handling