removed SID initialization from main loop