core: fix processing conditions in loop