Fixing SPN loops in gui