check if extension variable is set before trying to use it