Fix variable check