add stop application functionality