Check if ag exists before setting