application: fix infinite loop