fix variable check