add exit command

typing exit in prompt will exit the loop