Check for "ag" before trying to use it