added escape button to quit loop