corrected GA code