Bug solved in debugger