Added stopOnEsc option