added signal handler for sample app.