fixed bug242 multiple moodle and multiple irs
futher fixes for bug242