Changed application to stop by signal handling.