fix stopping application by timeout