added capability to terminate based on q key rather than needing to click button