To prevent proc breaking loop I have encapsulated the code in proc() in a try finally {return true;} I can't find the exact cause of this.