Put GA inside a function