Moves ga code to head because of async.