add command loop