Fixed addRG script