added variable check