Use the correct variables when checking for their definition