connection needs to be open for showResult to work.