Replace endless recursion with proper event schedule