changed button and exit signal handling