Debugging flowcontrol issue