Variable not being set after get request